for x in range(1,1000):
 sum=0
 for y in range(1,int(x/2)+1):
  if x/y==int(x/y):
   sum=sum+y
 if sum==x:
  print(x)